package com.ruoyi.celoan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.celoan.entity.ExTradeEffectFinancialproductsDetailEntity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ExTradeEffectFinancialproductsDetailMapper extends BaseMapper<ExTradeEffectFinancialproductsDetailEntity> {

    @Select("SELECT " +
            "  i.id, " +
            "  i.product_name AS NAME, " +
            "  i.audit_mode AS approval_mode, " +
            "  i.main_guarantee_way AS guarantee_mode, " +
            "  i.amount_limit_lower AS loan_limit_end, " +
            "  i.amount_limit_upper AS loan_limit_begin, " +
            "  i.loan_period_limit_upper AS loan_period_begin, " +
            "  i.loan_period_limit_lower AS loan_period_end, " +
            "  i.interest_rate_limit_upper AS rate_range_begin, " +
            "  i.interest_rate_limit_lower AS rate_range_end, " +
            "  i.belong_institution, " +
            "  0 AS policy_prod, " +
            "  CONVERT(e.product_description USING utf8mb4) AS t_desc, " +
            "  1 AS type, " +
            "  i.repayment_way AS repayments, " +
            "  i.service_area AS service_cities, " +
            "  i.product_short_name AS short_name, " +
            "  i.create_time AS released_time, " +
            "  UUID_SHORT() AS external_system_id, " +
            "  130400 AS area_code, " +
            "  i.create_time AS load_time, " +
            "  0 AS isflag, " +
            "  1306 AS platform_id " +
            "FROM " +
            "  pc_product_base_info i " +
            "  LEFT JOIN pc_product_extend_info e ON e.product_id = i.id " +
            "  LEFT JOIN ex_trade_effect_financialproducts_detail fd ON fd.id = i.id " +
            "WHERE " +
            "  i.create_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') " +
            "  AND fd.id IS NULL")
    List<ExTradeEffectFinancialproductsDetailEntity> selectCustomProductInfo();
}


/* Location:              D:\tuodayun\workspace\work\celoan-third-data-report-service-2.0.0-SNAPSHOT.jar!\BOOT-INF\classes\com\celoan\mapper\ExTradeEffectFinancialproductsDetailMapper.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */
